package com.ruoyi.buss.group.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.buss.group.mapper.DataCustomerGroupRelationMapper;
import com.ruoyi.buss.group.domain.DataCustomerGroupRelation;
import com.ruoyi.buss.group.service.IDataCustomerGroupRelationService;

/**
 * 客户和群体关系Service业务层处理
 * 
 * @author sxy
 * @date 2021-07-16
 */
@Service
public class DataCustomerGroupRelationServiceImpl implements IDataCustomerGroupRelationService 
{
    @Autowired
    private DataCustomerGroupRelationMapper dataCustomerGroupRelationMapper;

    /**
     * 查询客户和群体关系
     * 
     * @param idCard 客户和群体关系ID
     * @return 客户和群体关系
     */
    @Override
    public DataCustomerGroupRelation selectDataCustomerGroupRelationById(String idCard)
    {
        return dataCustomerGroupRelationMapper.selectDataCustomerGroupRelationById(idCard);
    }

    /**
     * 查询客户和群体关系列表
     * 
     * @param dataCustomerGroupRelation 客户和群体关系
     * @return 客户和群体关系
     */
    @Override
    public List<DataCustomerGroupRelation> selectDataCustomerGroupRelationList(DataCustomerGroupRelation dataCustomerGroupRelation)
    {
        return dataCustomerGroupRelationMapper.selectDataCustomerGroupRelationList(dataCustomerGroupRelation);
    }

    /**
     * 新增客户和群体关系
     * 
     * @param dataCustomerGroupRelation 客户和群体关系
     * @return 结果
     */
    @Override
    public int insertDataCustomerGroupRelation(DataCustomerGroupRelation dataCustomerGroupRelation)
    {
        dataCustomerGroupRelation.setCreateTime(DateUtils.getNowDate());
        return dataCustomerGroupRelationMapper.insertDataCustomerGroupRelation(dataCustomerGroupRelation);
    }

    /**
     * 修改客户和群体关系
     * 
     * @param dataCustomerGroupRelation 客户和群体关系
     * @return 结果
     */
    @Override
    public int updateDataCustomerGroupRelation(DataCustomerGroupRelation dataCustomerGroupRelation)
    {
        return dataCustomerGroupRelationMapper.updateDataCustomerGroupRelation(dataCustomerGroupRelation);
    }

    /**
     * 批量删除客户和群体关系
     * 
     * @param idCards 需要删除的客户和群体关系ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerGroupRelationByIds(String[] idCards)
    {
        return dataCustomerGroupRelationMapper.deleteDataCustomerGroupRelationByIds(idCards);
    }

    /**
     * 删除客户和群体关系信息
     * 
     * @param idCard 客户和群体关系ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerGroupRelationById(String idCard)
    {
        return dataCustomerGroupRelationMapper.deleteDataCustomerGroupRelationById(idCard);
    }
}
